﻿<div class="post" data-bind="visible: isVisible">
    <div>
        <a data-bind="attr: { href: permalink, title: title }" style="text-decoration: none;">
            <h1 data-bind="text: title"></h1>
        </a>
    </div>
    <div class="post-meta">
        Categories: <span data-bind="foreach: categories">
            <a class="category-link" data-bind="attr: {'href': url}, text: name"></a>
        </span>
        <span data-bind="visible: categories().length==0">Uncategorized</span>
        <br />
        Updated on <span data-bind="text: updatedTime"></span>
    </div>
    <div id="PostContent" class="post-content" data-bind="html: contents">
    </div>
    <div class="post-meta">
        Posted by <span data-bind="text: author"></span>&nbsp;on&nbsp;<span data-bind="text: time"></span>
        <br />
        Tags: <span data-bind="foreach: tags">
            <a class="category-link" data-bind="attr: {'href': url}, text: name"></a>
        </span>
        <span data-bind="visible: tags().length==0">Untagged</span>
    </div>
    <div>
        <a data-bind="attr: { href: permalink, title: title }">Permalink</a>
        |
        <a href="#" data-bind="text: commentText, click: viewComments"></a>
        |  
        <a href="#" data-bind="click: addComment">Your comment</a>
        <span data-bind="visible: isAuthor">|  
            <a href="#" data-bind="attr: { 'href': editLink }">Edit Post</a>
        </span>
    </div>

    @Html.Partial("CommentControl")
</div>
